Fix collision between sofdep unloading and hard symbol dependency#1301
Conversation
✅ Deploy Preview for kubernetes-sigs-kmm ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yevgeny-shnaidman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/assign @ybettan |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1301 +/- ##
==========================================
- Coverage 79.09% 73.78% -5.31%
==========================================
Files 51 68 +17
Lines 5109 5116 +7
==========================================
- Hits 4041 3775 -266
- Misses 882 1169 +287
+ Partials 186 172 -14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
TomerNewman
left a comment
There was a problem hiding this comment.
This way it will go over every module in the command and try to unload it
but if modprobe will do now modprobe -r a b c and when it tries to remove a, b will be removed too, no? so when modprobe will try to remove b it is already gone and because of that fail.
in this case modprobe just goes over every module it received in the command line and tries to remove, no matter if it is present or not. In case of softdep the flow is different |
| } | ||
| } | ||
|
|
||
| w.logger.Info("Unloading module", "name", moduleName) |
There was a problem hiding this comment.
if we already remove multiple modules, the logs will still show that we remove only a single module
e0351cf to
6c423df
Compare
| w.logger.Info("Starting unloading", "args", args) | ||
|
|
||
| if err := w.mr.Run(ctx, args...); err != nil { | ||
| return fmt.Errorf("could not unload module %s: %v", moduleName, err) |
There was a problem hiding this comment.
I would also change the log message here since we can unload multiple modules
| } | ||
|
|
||
| args = append(args, moduleName) | ||
| if len(cfg.Modprobe.ModulesLoadingOrder) > 0 { |
There was a problem hiding this comment.
in here
we check with ModulesLoadingOrder != nil, in order to be consistent with the code I would change to
cfg.Modprobe.ModulesLoadingOrder != nil
There was a problem hiding this comment.
using len is safer
|
/lgtm |
|
/unlgtm |
|
/remove-lgtm |
|
/hold |
|
/unhold I lgtmed accidently |
6c423df to
d5a9547
Compare
scenario: 1.KMM Modules needs to load module_a, module_b, module_c 2. module_a has a hard symbol dependency on module_b. 3. modulesLoadingOrder defined as: [module_a, module_b, module_c] There is no problems when loading. When unloading using softdep, the following happens 1. module_a is unloaded first 2. module_b is unloaded automatically, due to hard symbol dependency 3. modprobe looks at softdep, sees that module_b is unloaded, and does not continue to module_c This commit changes the Unload flow: 1. no softdep is created. 2. modprobe -r ocmmand is provided with the list of modules defined in the modulesLoadingOrder This way it will go over every module in the command and try to unload it
d5a9547 to
9dc420d
Compare
|
/lgtm |
scenario:
1.KMM Modules needs to load module_a, module_b, module_c
2. module_a has a hard symbol dependency on module_b.
3. modulesLoadingOrder defined as: [module_a, module_b, module_c]
There is no problems when loading. When unloading using softdep, the following happens
This commit changes the Unload flow:
This way it will go over every module in the command and try to unload it